home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Die Speccy' 97
/
Die Speccy' 97.iso
/
amiga_system
/
the_aminet
/
util
/
cli
/
gengui21.lha
/
Gengui2.1
/
lib
/
gengui.h
< prev
next >
Wrap
C/C++ Source or Header
|
1995-10-25
|
7KB
|
227 lines
#ifndef _GENGUI_LNK_H
#define _GENGUI_LNK_H
#ifdef __cplusplus
extern "C" {
#endif
#include <exec/types.h>
#include <libraries/gadtools.h>
#include <proto/gadtools.h>
#include <intuition/gadgetclass.h>
#define GG_VBOX -1
#define GG_HBOX -2
#define GG_CUSTOM_KIND -3
#define GG_PLAINTEXT_KIND -4
#define GG_GFXBUTTON_KIND -5
#define GG_MODE_NEW 0
#define GG_MODE_RESIZE 1
#define GG_MODE_REFRESH 2
#define GG_MODE_STOP 3
#define GG_MODE_FREE 4
#define GG_MODE_BACKUP 5
#define GG_MODE_RESTORE 6
/* Flags for struct GadDim */
#define GG_FLAG_CUSTOM 1
#define GG_FLAG_STRING 2
#define GG_FLAG_INTEGER 4
#define GG_FLAG_DISABLED 8
#define GG_FLAG_RAISED 16
#define GG_FLAG_RECESSED 32
#define GG_FLAG_BAR 64
#define GG_FLAG_RESIZED (1<<10)
#define GG_FLAG_DEFAULT_HEIGHT (1<<11)
#define GG_FLAG_DEFAULT_WIDTH (1<<12)
#define GG_FLAG_BACKUP (1<<13)
#define GG_FLAG_SKIPREFRESH (1<<14)
#define GG_FLAG_INITED (1<<15)
#if 0 /* old values */
#define GG_Left 0
#define GG_Top 0
#define GG_Right (1<<0)
#define GG_Bottom (1<<1)
#define GG_HCentered (1<<2)
#define GG_VCentered (1<<3)
#define GG_FullSize (1<<4)
#define GG_NoHighlight (1<<5)
#endif
/* These flags superseede some flags for gadgets and gadget-activation,
* that are not required for simple intuition boolean buttons, but
* are required for internal use of gengui.
* (NOTE: The activation flags are shifted 16 bits to the left)
*/
#define GG_Left 0
#define GG_Top 0
#define GG_Right 0x0200 /* GFLG_TABCYCLE */
#define GG_Bottom 0x0400 /* GFLG_STRINGEXTEND */
#define GG_HCentered 0x8000 /* GFLG_EXTENDED */
#define GG_VCentered 0x02000000 /* GACT_STRINGCENTER */
#define GG_FullSize 0x04000000 /* GACT_STRINGRIGHT */
#define GG_NoHighlight GFLG_GADGHNONE /* direct */
#define GG_IgnoreFlags (GG_Right|GG_Bottom|GG_HCentered|GG_VCentered|GG_FullSize)
#define GG_FLAG_TRADEMASK (GG_FLAG_CUSTOM|GG_FLAG_STRING|GG_FLAG_INTEGER)
#define GetString(g) (((struct StringInfo * )g->SpecialInfo)->Buffer)
#define GetNumber(g) (((struct StringInfo * )g->SpecialInfo)->LongInt)
#define GetInfo(g) ((struct GadInfo *)((g)->UserData))
#define GetUserData(g) (GetInfo(g)->UserData)
#define GetGadget(msg) ((struct Gadget *)msg->IAddress)
struct GadSpace {
UBYTE Chars,Pix; /* Space in characters / pixels */
};
struct GadDim {
int Kind;
USHORT Rx,Ry,Cx,Cy,Px,Py;
USHORT MinCx,MinCy,MinPx,MinPy;
USHORT SRx,SRy,SPx,SPy; /* Box: Sum of Rx,Px,...
Gadget: SRx: TextID
*/
USHORT XSpace,YSpace;
UBYTE LeftCSpace,RightCSpace,TopCSpace,BottomCSpace;
UBYTE LeftPSpace,RightPSpace,TopPSpace,BottomPSpace;
USHORT Flags; /* GG_FLAG ... */
};
struct Box {
struct GadDim Dim;
struct Hook *Backfill;
struct Box **Entry;
};
struct WinInfo {
struct Box *Box;
struct Gadget **Gadgets;
struct Gadget *Prev;
struct Window *Window;
struct Gadget *GList;
int FontX,FontY;
struct TextAttr TextAttr;
APTR Visual;
char Mode,Render;
};
struct GadInfo {
struct GadDim Dim;
int GadNum;
int __stdargs (*CustomFunc)(struct WinInfo *WInfo,
struct NewGadget *NewGad,
struct GadInfo *GadInfo,
int Left, int Top, int Width, int Height);
struct TextAttr *TextAttr;
const char *Text;
int GadgetID;
ULONG Flags,UserData;
int __stdargs (*HookFunc)(struct IntuiMessage *);
ULONG *Tags;
ULONG *SaveTags;
ULONG Code;
struct Gadget *ThisGad;
};
struct GG_ObjectSize {
int Width,Height;
};
void GG_GfxPrintSize(struct RastPort *rast,const char *text,struct GG_ObjectSize *size);
void GG_GfxPrint(struct RastPort *rast,const char *text,int left,int top);
int GG_RenderGui(struct Window *win, struct WinInfo *winfo);
int GG_SmartRenderGui(struct Window *win, struct WinInfo *winfo,struct TextFont **);
int GG_ResizeGui(struct WinInfo *winfo);
int GG_RefreshGui(struct WinInfo *winfo);
void GG_FreeGui(struct WinInfo *winfo);
void GG_StopGui(struct WinInfo *winfo);
int GG_SubGui(struct WinInfo *, struct WinInfo *,int ,int ,int , int );
void GG_ClearWindow(struct Window *);
struct IntuiMessage *GG_GetIMsg(struct MsgPort *userport);
BOOL GG_SetGadgetAttrs(struct Gadget *,struct Window *,struct Requester *, ULONG ,...);
BOOL GG_SetGadgetAttrsA(struct Gadget *,struct Window *,struct Requester *, ULONG *);
void GG_MinSize(struct Window *, struct WinInfo *,struct GG_ObjectSize *);
void GG_MinSizeFont(struct TextFont *, struct WinInfo *,struct GG_ObjectSize *);
BOOL GG_SetLowlevelAttrsA(struct GadInfo *gad, ULONG *Tag);
BOOL GG_SetLowlevelAttrs(struct GadInfo *gad, ULONG Tag1,...);
void GG_BeginResizeGui(struct WinInfo *winfo);
void GG_BeginRefresh(struct WinInfo *winfo);
void GG_EndRefresh(struct WinInfo *winfo, BOOL complete);
#define GG_ReplyIMsg(s) GT_ReplyIMsg(s);
#ifdef GG_OLDSTYLE
#define RenderGui GG_RenderGui
#define ResizeGui GG_ResizeGui
#define RefreshGui GG_RefreshGui
#define FreeGui GG_FreeGui
#define StopGui GG_StopGui
#define SubGui GG_SubGui
#define ClearWindow GG_ClearWindow
#define Gui_SetGadgetAttrs GG_SetGadgetAttrs
#define Gui_SetGadgetAttrsA GG_SetGadgetAttrsA
static struct IntuiMessage *Gui_GetIMsg(struct MsgPort *port,struct IntuiMessage *msg)
{
struct IntuiMessage *m;
if(m=GG_GetIMsg(port)) {
*msg=*m;
GG_ReplyIMsg(m);
return msg;
}
return NULL;
}
#define MODE_NEW GG_MODE_NEW
#define MODE_RESIZE GG_MODE_RESIZE
#define MODE_REFRESH GG_MODE_REFRESH
#define MODE_STOP GG_MODE_STOP
#define MODE_FREE GG_MODE_FREE
#define MODE_BACKUP GG_MODE_BACKUP
#define MODE_RESTORE GG_MODE_RESTORE
#define BOXFLG_CUSTOM GG_FLAG_CUSTOM
#define BOXFLG_STRING GG_FLAG_STRING
#define BOXFLG_INTEGER GG_FLAG_INTEGER
#define BOXFLG_DISABLED GG_FLAG_DISABLED
#define BOXFLG_RAISED GG_FLAG_RAISED
#define BOXFLG_RECESSED GG_FLAG_RECESSED
#define BOXFLG_BAR GG_FLAG_BAR
#define BOXFLG_BACKUP GG_FLAG_BACKUP
#define BOXFLG_INITED GG_FLAG_INITED
#define BOXFLG_SKIPREFRESH GG_FLAG_SKIPREFRESH
#define BOXFLG_DEFAULT_WIDTH GG_FLAG_DEFAULT_WIDTH
#define BOXFLG_DEFAULT_HEIGHT GG_FLAG_DEFAULT_HEIGHT
#define BOXFLG_TRADEMASK GG_FLAG_TRADEMASK
#define GL_VBOX GG_VBOX
#define GL_HBOX GG_HBOX
#define CUSTOM_KIND GG_CUSTOM_KIND
#define PLAINTEXT_KIND GG_PLAINTEXT_KIND
#define GFXBUTTON_KIND GG_GFXBUTTON_KIND
#endif
#ifdef __cplusplus
}
#endif
#endif